package com.springboot.cloud.sysadmin.organization.rest;

import com.springboot.cloud.common.core.entity.vo.Result;
import com.springboot.cloud.common.core.utils.MessageUtils;
import com.springboot.cloud.sysadmin.organization.entity.po.OperationLog;
import com.springboot.cloud.sysadmin.organization.manager.factory.AsyncFactory;
import com.springboot.cloud.sysadmin.organization.service.ILogininfoService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by ZengJian on 2021/2/3 0003 上午 9:22
 */
@RestController
@RequestMapping("/logininfo")
@Api("logininfo")
@Slf4j

public class LogininfoController {

    @GetMapping("/recordLogininfor")
    public Result recordLogininfor(String username, String status, String message
    ) {
        return Result.success(AsyncFactory.recordLogininfor(username, status, message, MessageUtils.message("user.login.success")));
    }

    @GetMapping("/recordOper")
    public Result recordOper(OperationLog operationLog) {

        return Result.success(AsyncFactory.recordOper(operationLog));
    }
}
